<?php

class ShowHandler extends CI_Model{
	public function addShow($show){
		$this->load->model('showDAL');	
		// Check if show exists
		if($this->showDAL->showExists($show) == FALSE){
			// Return true if show was added successfully
			if($this->showDAL->addShow($show) == TRUE){
				return TRUE;
			}
			// TODO: Errormessage - adding failed
			else return FALSE;
		}
		// TODO: Errormessage - show already exists
		else return FALSE;

	}
	public function deleteShow($name){
		$this->load->model('showDAL');
		if($this->showDAL->deleteShow($name)){
			return TRUE;
		}
		// TODO: Erroressage - deleting show failed
		else return FALSE;
	}
	public function addPerson($person){
		$this->load->model('showDAL');	
		// Check if person exists
		if($this->showDAL->personExists($person) == FALSE){
			// Return true if person was added successfully
			if($this->showDAL->addPerson($person) == TRUE){
				return TRUE;
			}
			// TODO: Errormessage - adding failed
			else return FALSE;
		}
		// TODO: Errormessage - person already exists
		else return FALSE;
	}
	public function deletePerson($person){
		$this->load->model('showDAL');
		if($this->showDAL->deletePerson($person)){
			return TRUE;
		}
		// TODO: Erroressage - deleting person failed
		else return FALSE;
	}

}